home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.4 / CAMD / examples / trans / imagebox.a < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.5 KB  |  60 lines

  1. ******* ibox.lib/SetupImageIBox *********************************************
  2. *
  3. *   NAME
  4. *       SetupImageIBox -- Compute coordinates for BOOPSI image class
  5. *
  6. *   SYNOPSIS
  7. *       SetupImageIBox( image, imp_draw, result )
  8. *                       a0     a1        a2
  9. *
  10. *       void __asm SetupImageIBox( register __a0 struct Image *,
  11. *                                  register __a1 struct impDraw *,
  12. *                                  register __a2 struct IBox * );
  13. *
  14. *   FUNCTION
  15. *       This function calculates the extent box for a BOOPSI image,
  16. *       taking the IM_DRAWFRAME message into account for dynamic boxes.
  17. *
  18. *   INPUTS
  19. *       image       - pointer to the Image structure
  20. *       imp_draw    - pointer to the impDraw message
  21. *       result      - where to place the resulting box.
  22. *
  23. *   EXAMPLE
  24. *
  25. *   NOTES
  26. *
  27. *   BUGS
  28. *
  29. *   SEE ALSO
  30. *       intuition/intuition.h
  31. *
  32. *****************************************************************************
  33. *    Written by Talin
  34. *
  35.             include        "exec/types.i"
  36.             include        "intuition/intuition.i"
  37.             include        "intuition/imageclass.i"
  38.  
  39.             SECTION        text,CODE
  40.  
  41.             xdef        _SetupImageIBox
  42.  
  43. _SetupImageIBox
  44.             move.l        ig_LeftEdge(a0),ibox_Left(a2)
  45.             move.l        ig_Width(a0),ibox_Width(a2)
  46.  
  47.             move.w        impd_OffsetX(a1),d1
  48.             add.w        d1,ibox_Left(a2)
  49.             move.w        impd_OffsetY(a1),d1
  50.             add.w        d1,ibox_Top(a2)
  51.  
  52.             cmp.l        #IM_DRAWFRAME,(a1)
  53.             blt.s        1$
  54.             move.w        impd_DimensionsWidth(a1),ibox_Width(a2)
  55.             move.w        impd_DimensionsHeight(a1),ibox_Height(a2)
  56.  
  57. 1$            rts
  58.  
  59.             end
  60.